Add JSON schema checking functionality for DRep and Gov action metadata #713
+878
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changelog
Context
The objective is addressing this issue: IntersectMBO/cardano-cli#906
This PR adds 3 functions to the API that should be the only ones needed by the
cardano-cli
in order to implement this functionality:isDRepRegOrUpdateCert
- Checks whether a certificate is for DRep registration or DRep update.validateDRepAnchorData
- Checks whether aByteString
is valid JSON and conforms to CIP-0119.validateGovActionAnchorData
- Checks whether aByteString
is valid JSON and conforms to CIP-0108This PR is a requirement from PR #995 that implements the checking in
cardano-cli
and is based of the version ofcardano-api
in this PR.Related PRs in
CIPs
repo:@
beforetype
field nameCIP-0008
is in capital lettersHow to trust this PR
Tests should give some assurance. They are taken from the CIPs repo, with some adaptations that I have already created PRs in
CIPs
repo for (see above).The main thing to check here is the accuracy of the checks (are they enough, are they too much, are they right).
Could be useful to check the
cardano-cli
PR together with this one.Checklist